﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;

namespace WpfApp6
{
    public class MyCommand : ICommand
    {
        public event Action _exeCuteAction;
        public MyCommand(Action action) {
            _exeCuteAction += action;
        }
        public event EventHandler CanExecuteChanged;

        public bool CanExecute(object parameter)
        {
            return true;
        }

        public void Execute(object parameter)
        {
            _exeCuteAction.Invoke();
        }
    }
}
